#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableHeroFashionDao:DaoBase<TableHeroFashion>
    {
        public override string GetFileName()
        {
            return "TableHeroFashion.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableHeroFashion>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddOneIndex(TableHeroFashion model)
        {
            if (!cacheOneIndex.ContainsKey(model.heroId.ToString()))
            {
                cacheOneIndex[model.heroId.ToString()] = new List<TableHeroFashion>();
            }
            cacheOneIndex[model.heroId.ToString()].Add(model);
        }
        public override void AddPrimaryIndex(TableHeroFashion model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.fashionId)) UnityEngine.Debug.LogError("数据表id重复:TableHeroFashion->id: " + model.fashionId);
            #endif
            cachePrimaryInt[model.fashionId] = model;
        }
        protected override TableHeroFashion ParseRowData(string[] rowData)
        {
            TableHeroFashion data = new TableHeroFashion();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.fashionId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.heroId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.isDefault = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.isHide = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.specialShowType = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.specialShowArgs = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.sort = int.Parse(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.propAdd = rowData[7];
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.fightBuffIds = int.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.unlockType = int.Parse(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.cost = rowData[10];
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.icon = rowData[11];
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.fashionName = string.Intern(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.modelId = int.Parse(rowData[13]);
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.fashionDesc = rowData[14];
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.winSound = rowData[15];
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.enterSound = rowData[16];
            }
            if (!string.IsNullOrEmpty(rowData[17]))
            {
                data.formationOnSound = rowData[17];
            }
            if (!string.IsNullOrEmpty(rowData[18]))
            {
                data.petId = int.Parse(rowData[18]);
            }
            return data;
        }
    }
}
